package redis;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.Transaction;

public class TestPing {
    public static void main(String[] args) {
        Jedis jedis = new Jedis("192.168.56.100", 6379);
        jedis.set("ylhname", "yuliuhui");
        System.out.println(jedis.get("ylhname"));

        Transaction multi = jedis.multi();
        try {
            multi.set("sdf", "fjie");
            multi.exec();
        } catch (Exception e) {
            multi.discard();
            e.printStackTrace();
        } finally {
            jedis.close();
        }


    }
}
